﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common
{
   public class ObjectPoolsManager
    {
      //  https://www.cnblogs.com/kellynic/p/9768452.html
//        var pool = new SafeObjectPool.ObjectPool<MemoryStream>(10, () => new MemoryStream(), obj => {
//            if (DateTime.Now.Subtract(obj.LastGetTime).TotalSeconds > 5)
//            {
//                // 对象超过5秒未活动，进行操作
//            }
//        });

//        var obj = pool.Get(); //借
//        pool.Return(obj); //归还

////或者 using 自动归还
//using (var obj = pool.Get()) {
//}





    }
}
